<include file="common:__head__"/>
<div class="permissions-tabs">
    <a class="role tabs-bg" href="{:U('Agent/index')}">代理列表</a>
</div>
<div class="permissions-content">
    <form class="form-horizontal" id="set_rank" action="{:U('Agent/set_rank')}" method="post">
        <div class="permissions-le">
            <span class="add-admin"><a href="javascript:history.go(-1)"></a>返回上一步</span>
            <foreach name="agent_brands" item="ranks">
                <div class="add-admin-ipt">
                    <input type="hidden" name="brand_id[]" value="{$ranks['brand_id']}"/>
                    <span>{$ranks['b_name']}</span>
                    <select name="rank_id[]">
                        <option value="0">不代理此品牌</option>
                        <foreach name="ranks['ranks']" item="rank">
                            <option value="{$rank['rank_id']}" <if condition="$rank['rank_id'] eq $ranks['rank_id']">selected</if>>
                            {$rank['rank_name']}
                            </option>
                        </foreach>
                    </select>
                </div>
            </foreach>
            <div class="add-admin-ipt">
                <span></span>
                <a class="btn-lg btn-blue" id="submitBtn">保存</a>
            </div>
            <input type="hidden" name="meid" value="{$meid}"/>
            <input type="hidden" name="agent_id" value="{$agent_id}"/>
        </div>
    </form>
    <div class="permissions-ri">
        <a href="" class="permissions-help">帮助和服务</a>
    </div>
</div>

<script>
    $(function(){
        $('#submitBtn').click(function () {
            $("#set_rank").submit();
        });
    });
</script>
<include file="common:__foot__"/>